package thinkinjava4.ch13_strings;

public class IntegerMatch {
    public static void main(String[] args) {
        //'-?'表示-号可以有0个或多个;'\d+'表示可以有1个或多个数字
        System.out.println("-1234".matches("-?\\d+"));
        System.out.println("5678".matches("-?\\d+"));
        System.out.println("+911".matches("-?\\d+"));
        System.out.println("+911".matches("([-+])?\\d+"));
    }
}
